using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ImageAnalystTools._MultidimensionalAnalysis
{
    /// <summary>
    /// <para>Find Argument Statistics</para>
    /// <para>Extracts the dimension value  or band index at which a given statistic is attained for each pixel in a multidimensional or multiband raster.</para>
    /// <para>提取多维或多波段栅格中每个像素的给定统计数据的维度值或波段索引。</para>
    /// </summary>    
    [DisplayName("Find Argument Statistics")]
    public class FindArgumentStatistics : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FindArgumentStatistics()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input Multidimensional or Multiband Raster</para>
        /// <para>The input multidimensional or multiband raster to be analyzed.</para>
        /// <para>要分析的输入多维或多波段栅格。</para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output Raster</para>
        /// <para>The output raster dataset.</para>
        /// <para>输出栅格数据集。</para>
        /// </param>
        public FindArgumentStatistics(object _in_raster, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Image Analyst Tools";

        public override string ToolName => "Find Argument Statistics";

        public override string CallName => "ia.FindArgumentStatistics";

        public override List<string> AcceptEnvironments => ["cellSize", "compression", "configKeyword", "extent", "geographicTransformations", "nodata", "outputCoordinateSystem", "parallelProcessingFactor", "pyramid", "rasterStatistics", "resamplingMethod", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_raster, _dimension, _dimension_def.GetGPValue(), _interval_keyword.GetGPValue(), _variables, _statistics_type.GetGPValue(), _min, _max, _multiple_occurrence, _ignore_nodata.GetGPValue()];

        /// <summary>
        /// <para>Input Multidimensional or Multiband Raster</para>
        /// <para>The input multidimensional or multiband raster to be analyzed.</para>
        /// <para>要分析的输入多维或多波段栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Multidimensional or Multiband Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output Raster</para>
        /// <para>The output raster dataset.</para>
        /// <para>输出栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Dimension</para>
        /// <para>The dimension from which the statistic will be extracted. If the input raster is not a multidimensional raster, this parameter is not required.</para>
        /// <para>将从中提取统计数据的维度。如果输入栅格不是多维栅格，则不需要此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dimension")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _dimension { get; set; } = null;


        /// <summary>
        /// <para>Dimension Definition</para>
        /// <para><xdoc>
        ///   <para>Specifies how the statistic will be extracted from the dimension.</para>
        ///   <bulletList>
        ///     <bullet_item>All—The statistic will be extracted across all dimensions. This is the default.</bullet_item><para/>
        ///     <bullet_item>Interval Keyword—The statistic will be extracted from the time dimension according to the interval keyword.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何从维度中提取统计数据。</para>
        ///   <bulletList>
        ///     <bullet_item>全部—将跨所有维度提取统计数据。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>间隔关键字 - 将根据 interval 关键字从时间维度中提取统计数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dimension Definition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _dimension_def_value _dimension_def { get; set; } = _dimension_def_value._ALL;

        public enum _dimension_def_value
        {
            /// <summary>
            /// <para>All</para>
            /// <para>All—The statistic will be extracted across all dimensions. This is the default.</para>
            /// <para>全部—将跨所有维度提取统计数据。这是默认设置。</para>
            /// </summary>
            [Description("All")]
            [GPEnumValue("ALL")]
            _ALL,

            /// <summary>
            /// <para>Interval Keyword</para>
            /// <para>Interval Keyword—The statistic will be extracted from the time dimension according to the interval keyword.</para>
            /// <para>间隔关键字 - 将根据 interval 关键字从时间维度中提取统计数据。</para>
            /// </summary>
            [Description("Interval Keyword")]
            [GPEnumValue("INTERVAL_KEYWORD")]
            _INTERVAL_KEYWORD,

        }

        /// <summary>
        /// <para>Keyword Interval</para>
        /// <para><xdoc>
        ///   <para>The unit of time for which the statistic will be extracted.</para>
        ///   <para>For example, you have five years of daily sea surface temperature data and you want to know the year in which the maximum temperature was observed. Set Statisitcs Type to Argument of the maximum, set Dimension Definition to Interval Keyword, and set Keyword Interval to Yearly.</para>
        ///   <para>Alternatively, if you want to know the month in which the maximum temperature was consistently observed, set Statistics Type to Argument of the maximum, setDimension Definition to Interval Keyword, and set Keyword Interval to Recurring Monthly. This will generate a raster in which each pixel contains the month in which the statistic was reached across the five-year record (08/18/2018, 08/25/2016, 08/07/2013, for example).</para>
        ///   <para>This parameter is required when the Dimension parameter is set to StdTime and the Dimension Definition parameter is set to Interval Keyword.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>提取统计数据的时间单位。</para>
        ///   <para>例如，您有五年的每日海面温度数据，并且您想知道观测到最高温度的年份。将“统计类型”设置为“最大参数”，将“维度定义”设置为“间隔关键字”，将“关键字间隔”设置为“每年”。</para>
        ///   <para>或者，如果想知道始终观察到最高温度的月份，请将“统计类型”设置为“最大值的参数”，将“维度定义”设置为“间隔关键字”，并将“关键字间隔”设置为“每月定期”。这将生成一个栅格，其中每个像素都包含五年记录（例如，2018 年 8 月 18 日、2016 年 8 月 25 日、2013 年 8 月 7 日）达到统计数据的月份。</para>
        ///   <para>当 Dimension 参数设置为 StdTime，Dimension Definition 参数设置为 Interval 关键字时，需要此参数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Keyword Interval")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _interval_keyword_value? _interval_keyword { get; set; } = null;

        public enum _interval_keyword_value
        {
            /// <summary>
            /// <para>Hourly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Hourly")]
            [GPEnumValue("HOURLY")]
            _HOURLY,

            /// <summary>
            /// <para>Daily</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Daily")]
            [GPEnumValue("DAILY")]
            _DAILY,

            /// <summary>
            /// <para>Weekly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Weekly")]
            [GPEnumValue("WEEKLY")]
            _WEEKLY,

            /// <summary>
            /// <para>Monthly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Monthly")]
            [GPEnumValue("MONTHLY")]
            _MONTHLY,

            /// <summary>
            /// <para>Quarterly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Quarterly")]
            [GPEnumValue("QUARTERLY")]
            _QUARTERLY,

            /// <summary>
            /// <para>Yearly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Yearly")]
            [GPEnumValue("YEARLY")]
            _YEARLY,

            /// <summary>
            /// <para>Recurring Daily</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Recurring Daily")]
            [GPEnumValue("RECURRING_DAILY")]
            _RECURRING_DAILY,

            /// <summary>
            /// <para>Recurring Weekly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Recurring Weekly")]
            [GPEnumValue("RECURRING_WEEKLY")]
            _RECURRING_WEEKLY,

            /// <summary>
            /// <para>Recurring Monthly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Recurring Monthly")]
            [GPEnumValue("RECURRING_MONTHLY")]
            _RECURRING_MONTHLY,

            /// <summary>
            /// <para>Recurring Quarterly</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("Recurring Quarterly")]
            [GPEnumValue("RECURRING_QUARTERLY")]
            _RECURRING_QUARTERLY,

        }

        /// <summary>
        /// <para>Variables [Dimension Info] (Description)</para>
        /// <para><xdoc>
        ///   <para>The variable or variables to be analyzed. If the input raster is not multidimensional, the pixel values of the multiband raster are considered the variable. If the input raster is multidimensional and no variable is specified, all variables with the selected dimension will be analyzed.</para>
        ///   <para>For example, to find the years in which temperature values were highest, specify temperature as the variable to be analyzed. If you do not specify any variables and you have both temperature and precipitation variables, both variables will be analyzed, and the output multidimensional raster will include both variables.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要分析的一个或多个变量。如果输入栅格不是多维栅格，则将多波段栅格的像素值视为变量。如果输入栅格为多维栅格且未指定变量，则将分析具有所选维度的所有变量。</para>
        ///   <para>例如，要查找温度值最高的年份，请将温度指定为要分析的变量。如果未指定任何变量，并且同时具有温度和降水变量，则将对这两个变量进行分析，并且输出多维栅格将同时包含这两个变量。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Variables [Dimension Info] (Description)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _variables { get; set; } = null;


        /// <summary>
        /// <para>Statistics Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the statistic to extract from the variable or variables along the given dimension.</para>
        ///   <bulletList>
        ///     <bullet_item>Argument of the minimum—The dimension value at which the minimum variable value is reached will be extracted. This is the default.</bullet_item><para/>
        ///     <bullet_item>Argument of the maximum—The dimension value at which the maximum variable value is reached will be extracted.</bullet_item><para/>
        ///     <bullet_item>Argument of the median—The dimension value at which the median variable value is reached will be extracted.</bullet_item><para/>
        ///     <bullet_item>Duration—The longest dimension duration value between the minimum and maximum variable values will be extracted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要从给定维度上的一个或多个变量中提取的统计数据。</para>
        ///   <bulletList>
        ///     <bullet_item>最小值的参数 - 将提取达到最小变量值的维度值。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>最大值的参数 - 将提取达到最大变量值的维度值。</bullet_item><para/>
        ///     <bullet_item>中位数的参数 - 将提取达到中值变量值的维度值。</bullet_item><para/>
        ///     <bullet_item>持续时间—将提取介于最小变量值和最大变量值之间的最长维度持续时间值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Statistics Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _statistics_type_value _statistics_type { get; set; } = _statistics_type_value._ARGUMENT_MIN;

        public enum _statistics_type_value
        {
            /// <summary>
            /// <para>Argument of the minimum</para>
            /// <para>Argument of the minimum—The dimension value at which the minimum variable value is reached will be extracted. This is the default.</para>
            /// <para>最小值的参数 - 将提取达到最小变量值的维度值。这是默认设置。</para>
            /// </summary>
            [Description("Argument of the minimum")]
            [GPEnumValue("ARGUMENT_MIN")]
            _ARGUMENT_MIN,

            /// <summary>
            /// <para>Argument of the maximum</para>
            /// <para>Argument of the maximum—The dimension value at which the maximum variable value is reached will be extracted.</para>
            /// <para>最大值的参数 - 将提取达到最大变量值的维度值。</para>
            /// </summary>
            [Description("Argument of the maximum")]
            [GPEnumValue("ARGUMENT_MAX")]
            _ARGUMENT_MAX,

            /// <summary>
            /// <para>Argument of the median</para>
            /// <para>Argument of the median—The dimension value at which the median variable value is reached will be extracted.</para>
            /// <para>中位数的参数 - 将提取达到中值变量值的维度值。</para>
            /// </summary>
            [Description("Argument of the median")]
            [GPEnumValue("ARGUMENT_MEDIAN")]
            _ARGUMENT_MEDIAN,

            /// <summary>
            /// <para>Duration</para>
            /// <para>Duration—The longest dimension duration value between the minimum and maximum variable values will be extracted.</para>
            /// <para>持续时间—将提取介于最小变量值和最大变量值之间的最长维度持续时间值。</para>
            /// </summary>
            [Description("Duration")]
            [GPEnumValue("DURATION")]
            _DURATION,

        }

        /// <summary>
        /// <para>Minimum Value</para>
        /// <para><xdoc>
        ///   <para>The minimum variable value to be used to extract the duration.</para>
        ///   <para>This parameter is required when the Statistics Type parameter is set to Duration.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于提取持续时间的最小变量值。</para>
        ///   <para>当统计类型参数设置为持续时间时，此参数是必需的。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _min { get; set; } = null;


        /// <summary>
        /// <para>Maximum Value</para>
        /// <para><xdoc>
        ///   <para>The maximum variable value to be used to extract the duration.</para>
        ///   <para>This parameter is required when the Statistics Type parameter is set to Duration.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于提取持续时间的最大变量值。</para>
        ///   <para>当统计类型参数设置为持续时间时，此参数是必需的。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _max { get; set; } = null;


        /// <summary>
        /// <para>Multiple Occurrence Value</para>
        /// <para>The pixel value to use to indicate that a given argument statistic was reached more than once in the input raster dataset. If not specified, the pixel value will be the value of the dimension the first time the argument statistic is reached.</para>
        /// <para>用于指示在输入栅格数据集中多次达到给定参数统计数据的像素值。如果未指定，则像素值将是首次到达参数统计信息时维度的值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Multiple Occurrence Value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _multiple_occurrence { get; set; } = null;


        /// <summary>
        /// <para>Ignore NoData</para>
        /// <para><xdoc>
        ///   <para>Specifies whether NoData values are ignored in the analysis.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The analysis will include all valid pixels along a given dimension and ignore any NoData pixels. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The analysis will result in NoData if there are any NoData values for the pixels along the given dimension.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否在分析中忽略 NoData 值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 分析将包括给定维度上的所有有效像素，并忽略任何 NoData 像素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果给定维度上的像素有任何 NoData 值，则分析将生成 NoData。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore NoData")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_nodata_value _ignore_nodata { get; set; } = _ignore_nodata_value._true;

        public enum _ignore_nodata_value
        {
            /// <summary>
            /// <para>DATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NODATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NODATA")]
            [GPEnumValue("false")]
            _false,

        }

        public FindArgumentStatistics SetEnv(object cellSize = null, object compression = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object nodata = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object pyramid = null, object rasterStatistics = null, object resamplingMethod = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(cellSize: cellSize, compression: compression, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, nodata: nodata, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, pyramid: pyramid, rasterStatistics: rasterStatistics, resamplingMethod: resamplingMethod, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}